package com.chenjinyan.user.service;

import com.chenjinyan.user.entity.UserEntity;
import com.chenjinyan.user.vo.User;

import java.text.ParseException;
import java.util.List;

/**
 * @author chenjinyan
 * @version 1.0
 */
public interface UserService {

    /**
     * @param user 用户
     * @Description: 增加用户
     * @return: int
     */
    int insertUser(User user) throws ParseException;

    /**
     * @param user 用户
     * @Description: 增加用户
     * @return: int
     */
    int updateUser(User user) throws ParseException;

    /**
     * @param loginAccount 登陆账号
     * @Description: 登陆账号查找重复用户
     * @return: int
     */
    int checkByLoginAcc(String loginAccount) throws ParseException;

    /**
     * @param phone 电话号码
     * @Description: 电话号码查找重复用户
     * @return: int
     */
    int checkByPhone(String phone) throws ParseException;

    /**
     * @param email 邮箱
     * @Description: 邮箱查找重复用户
     * @return: int
     */
    int checkByEmail(String email) throws ParseException;


    /**
     * @param id 用户id
     * @Description: 邮箱查找重复用户
     * @return: int
     */
    List<UserEntity> getUserInfo(Long id) throws ParseException;

    /**
     * @Description: id查找用户
     */
    UserEntity findById(Long id) throws ParseException;

    /**
     * @param username 登陆名称
     * @param password 密码
     * @Description: 邮箱查找重复用户
     * @return: int
     */
    int findByUsernameAndPassword(String username, String password) throws ParseException;

    int updateLoginTime(String username);
}
